package ex133;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		
		InputStreamReader it = new InputStreamReader(System.in);
		BufferedReader in = new BufferedReader(it);
		
		int x = Integer.parseInt(in.readLine());
		int y = Integer.parseInt(in.readLine());
		
		int min = Math.min(x, y) + 1;
		int max = Math.max(x, y);
		for (int i = min; i < max; i++) {
			
			if (i % 5 == 2 || i % 5 == 3) {
				System.out.println(i);
			}
			
		}
		
	}

}
